﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core;

namespace DataAccess
{
    public class ChiTietDatHang_Info
    {
        public int IDDatHang { get; set; }
        public int IDSanPham { get; set; }
        public int SoLuong { get; set; }
        //thêm
        public static bool ChiTietDatHang_Them(int IDDatHang, int IDSanPham, int SoLuong)
        {
            try
            {
                object rs = DataProvider.Instance.ExecuteNonQuery("sp_ChiTietDatHang_Them",IDDatHang, IDSanPham, SoLuong);
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }

        public static List<ChiTietDatHang_Info> ChiTietDatHang_Chon(int IDdathang)
        {
            try
            {
                return
                    CBO.FillCollection<ChiTietDatHang_Info>(DataProvider.Instance.ExecuteReader("sp_ChiTietDatHang_Chon",
                                                                                         IDdathang));
            }
            catch
            {
                return null;
            }
        }

    }
}
